<template>
  <div class="app">
    <header>
      <nav>
        <span @click="fh">取消</span>
        <span>编辑简介</span>

        <button class="save" id="save" @click="bao">保存</button>
        <div c></div>
      </nav>
    </header>
    <div class="remind">七天内可修改三次简介</div>
    <div class="input_frame">
      <van-field
        v-model="message"
        rows="2"
        autosize
        type="textarea"
        maxlength="100"
        placeholder="点击填写兴趣爱好,生活方式等个人简介"
        show-word-limit
      />
    </div>
  </div>
</template>
  
  <script>
  import { change_name } from "@/api/personal";
export default {
  data() {
    return {
      message: "",
        uid: '',
    };
  },
  methods: {
    fh() {
      this.$router.go(-1);
      //返回上一页
    },
    bao() {
      let data = JSON.parse(localStorage.getItem("userid"));
      this.d =  data + "";
      change_name({
        intro:this.message,
          uid:this.uid
      })
        .then((res) => {
          console.log(this.message);
          console.log(res);
        })
        .catch((rest) => {
          console.log(123);
        });
    },
  },
};
</script >
  
  <style scoped>
.app {
  width: 100vw;
  height: 100vh;
  background: #f1f1f1;
}
header {
  width: 100%;
  height: 40px;
}
nav {
  height: 40px;
  display: flex;
  align-items: flex-end;
}
nav span:nth-child(1) {
  margin-left: 20px;
  font-size: 16px;
  color: rgb(190, 189, 189);
}
nav span:nth-child(2) {
  margin-left: 110px;
  font-size: 18px;
  color: rgb(0, 0, 0);
}
.remind {
  margin-top: 20px;
  margin-left: 30px;
  width: 160px;
  height: 20px;
  font-size: 14px;
}
.input_frame {
  margin-top: 10px;
  border-radius: 8px;
  margin-left: 20px;
  width: 350px;
  height: 40px;
  background-color: rgb(255, 255, 255);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.input_frame {
  margin-top: 30px;
}
p {
  margin-top: 120px;
  margin-right: 10px;
  color: rgb(156, 156, 156);
}
.regulation {
  width: 300px;
  color: rgb(190, 189, 189);
  font-size: 13px;
  margin-left: 30px;
  margin-top: 10px;
  /* display: none; */
}
.save {
  margin-left: 100px;
  font-size: 16px;
  color: rgb(255, 160, 160);
  background: transparent;
  border: 0;
}
</style>